import logging
import os

from base.os_utils import execute_short_command, get_env_param


def rsa_encode(expect_encoded_origin_data):
    return execute_short_command(f"java -jar {get_env_param('pro_root_path')}/jar/Encode_RSA.jar {get_env_param('rsa_public_key')} {expect_encoded_origin_data}").replace('\n','')

def rsa_decode(encoded_data):
    return execute_short_command(f"java -jar {get_env_param('pro_root_path')}/jar/Decode_RSA.jar {get_env_param('rsa_private_key')} {encoded_data}").replace('\n','')
